; Define the regex pattern to match window classes
RegexPattern := "^Mirror's Edge"

; Initialize an empty variable to store the results
MatchingWinID := ""
MatchingWinClass := ""

; Get a list of all open windows
WinGet, WindowIDs, List

; Loop through each window
Loop, %WindowIDs%
{
    ; Get the window ID
    WindowID := WindowIDs%A_Index%

    ; Get the window class
    WinGetClass, WindowClass, ahk_id %WindowID%

    ; Check if the window class matches the regex pattern
    if (RegExMatch(WindowClass, RegexPattern))
    {
        ; Append the matching WinID and class to the results
        MatchingWinID .= WindowID
        MatchingWinClass .= WindowClass
        MsgBox, 64, Success, %MatchingWinID% %MatchingWinClass%.
        Break
    }
}

; Check if any matches were found
if (MatchingWinID = "")
{
    ; No matches found, display an error message
    MsgBox, 16, Error, No windows found matching the regex pattern: %RegexPattern%
}
